<title>公告管理</title>
  
<div class="layui-card layadmin-header">
  <div class="layui-breadcrumb" lay-filter="breadcrumb">
    <a lay-href="">主页</a>
    <a><cite>应用</cite></a>
    <a><cite>公告管理</cite></a>
  </div>
</div>


<div class="layui-fluid">
  <div class="layui-row layui-col-space15">
    <div class="layui-col-md12">
  <div class="layui-card">
   <div class="layui-card-header">公告管理</div>
    <div class="layui-card-body">
    
      <div style="padding-bottom: 10px;">
        <button class="layui-btn btn_action" data-type="add" title="添加公告" data-view="app/notice/edit">添加</button>
        <button class="layui-btn btn_action" data-type="del">删除</button>
      </div>
      
      <table id="J_table_list" lay-filter="J_table_list"></table>
      <script type="text/html" id="J_table_tool">
        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit" title="编辑公告" data-view="app/notice/edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
      </script>
    </div>
    
  </div>
</div>
  </div>
</div>

<script>
global.url = {
        edit:global.host+'/announce/edit'
        ,del:global.host+'/announce/del'
        ,add:global.host+'/announce/add'
};
layui.use(['admin', 'wendasns', 'table'], function(){
  var $ = layui.$
  ,admin = layui.admin
  ,table = layui.table
  ,form = layui.form;
  
  //执行渲染
table.render({
  elem: '#J_table_list'
  ,url: global.host+'/announce/index'
  ,cols: [[
      {type: 'checkbox',fixed:'left'}
      ,{field:'id',title:'ID',hide:'true'}
      ,{field:'sort',title:'顺序',width:80}
      ,{field:'subject',title:'公告',minWidth:100}
      ,{field:'state',title:'状态',width:80,templet:function(d){return '发布中';}}
      ,{field:'username',title:'发布者',width:120}
      ,{field:'create_time',title:'开始时间',width:160}
      ,{field:'update_time',title:'结束时间',width:160}
      ,{title:'操作',width:150,align:'center',toolbar:'#J_table_tool'}
  ]]
  ,page: true
    ,limit: 20
    ,height: 'auto'
  ,text: '对不起，加载出现异常！'
});

});
</script>